#include <pthread.h>
#include "rocket/common/log.h"
#include "rocket/common/config.h"


void* fun(void*) {

  int i = 20;
  while (i--) {
    LOG_DEBUG("debug this is thread in %s", "fun");
    LOG_INFO("info this is thread in %s", "fun");
  }

  return nullptr;
}

int main() {

  rocket::Config::SetGlobalConfig("/home/orange/tinytiny-rpc/tinytinyRPC/conf/rocket.xml");

  rocket::Logger::InitGlobalLogger();


  pthread_t thread;
  pthread_create(&thread, nullptr, &fun, nullptr);

  int i = 20;
  while (i--) {
    LOG_DEBUG("test debug log %s", "11");
    LOG_INFO("test info log %s", "11");
  }

  pthread_join(thread, nullptr);
  rocket::Logger::GetGlobalLogger()->flush();
  return 0;
}